﻿using System;
using System.Collections.Generic;
using System.Text;
using DataAccess;
using System.Data;
using Entity;

namespace BusinessObject
{
    public class OrderBO
    {
        OrderDA oDA = new OrderDA();

        public DataSet getOrder()
        {
            DataSet dt = oDA.getOrder();
            return dt;
        }

        public bool createOrder(int cusID, int subId, string date)
        {
            Orders o = new Orders();
            o.CustomerID = cusID;
            o.SubCategoryID = subId;
            o.CreateDate = date;
            if (oDA.CreateOrder(o))
            {
                return true;
            }
            return false;
        }

        public Orders selectOrderById(int id)
        {
            Orders o = oDA.getOrderById(id);
            return o;
        }

        public bool updateOrder(Orders o)
        {
            if (oDA.UpdateOrder(o))
            {
                return true;
            }
            return false;
        }

        public bool removeOrder(Orders o)
        {
            if (oDA.DeleteOrder(o))
            {
                return true;
            }
            return false;
        }

    }
}
